#ifndef MAINWINDOW_H
#define MAINWINDOW_H


#include <root.h>
#include <collectiontreemodel.h>


#include <QMainWindow>
#include <QFileInfo>


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected slots:

    void onMergeDoc();
    void onCloseDoc();

    void onCurrentRowChanged(QModelIndex ,QModelIndex);

protected:

    virtual void closeEvent(QCloseEvent *e);

    QModelIndex collectionIndex(const QModelIndex& index) const;

private slots:
    void on_actionNew_triggered();

    void on_actionOpen_triggered();

    void on_actionSave_As_triggered();

    void on_actionSave_triggered();

    void on_actionQuit_triggered();

    void on_actionRemove_triggered();

    void on_actionAdd_triggered();

    void on_actionAdd_Character_Class_triggered();

    void on_actionEdit_Item_triggered();

    void on_actionCloseEditor_triggered();

    void on_actionZoomIn_triggered();

    void on_actionZoomOut_triggered();

    void on_actionViewCampaign_triggered();

    void on_actionViewSheets_triggered();

    void on_actionViewXml_triggered();

    void on_stackedWidget_currentChanged(int index = 0);

private:
    Ui::MainWindow *ui;

    RootPtr              m_root;
    CollectionTreeModel* m_model;

    QString              m_file;

};

#endif // MAINWINDOW_H
